package com.retail.shopping.server.controller;

import com.retail.common.core.domain.Result;
import com.retail.order.vo.OrderRequest;
import com.retail.shopping.common.domain.request.CartInsertRequest;
import com.retail.shopping.server.service.CartService;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 功能描述:
 *
 * @version: java version 1.8
 * @author: liguangyao
 * @date: 2024-02-28 上午 10:45
 */
@RestController
@RequestMapping("/cart")
public class CartController {

    @Autowired
    private CartService cartService;


    //新增购物车
    @PostMapping("/cartInsert")
    public Result cartInsert(@RequestBody CartInsertRequest cartInsertRequest){
        Result result = cartService.cartInsert(cartInsertRequest);
        return result;
    }

    @GetMapping("/submitGetUUID")
    public Result getUUID(){
        return cartService.submitGetUUID();
    }

    @PostMapping("/remoteAddOrder")
    public Result remoteAddOrder(@RequestBody OrderRequest orderRequest){
        return cartService.remoteAddOrder(orderRequest);
    }



}
